#include <vector>
#include <string>
using namespace std;

class RabinKarp {
public:
	RabinKarp(string wordToSearch);
	void getNext(string text, vector<int>& mathces, int beforeLength);
private:
	string word;
	int p; 
	vector<int> pow_p;
	int hash(int start, int length, int oldHash, string text);
};